package com.smartthinking.destinomusical;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.smartthinking.destinomusical.db.ControlBD;

public class Splash extends Activity  {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		//new WSCurrencyCallTask(this, this).execute();
		Handler x = new Handler();
		x.postDelayed(new SplashHandler(),2000);
	}
	
	class SplashHandler implements Runnable{
		public void run(){
			ControlBD bd = new ControlBD(Splash.this);
			Intent intent = new Intent(Splash.this, MainActivity.class);
			intent.putExtra("usuario", bd.selectUser());
			startActivity(intent);	
		}
	}

//	@Override
//	public void onWSCurrencyInterfaceComplete(Double currency) {
//		ControlBD bd = new ControlBD(Splash.this);
//		boolean exist = bd.currencyExists();
//		if(exist)
//			bd.updateCurrency(currency);
//		else{
//			exist = bd.insertCurrency(currency);
//		}
//		Intent intent = new Intent(Splash.this, MainActivity.class);
//		intent.putExtra("usuario", bd.selectUser());
//		startActivity(intent);
//		
//	}
//
//	@Override
//	public void onWSCurrencyInterfaceCancel(boolean cancelado) {
//		// TODO Auto-generated method stub
//		
//	}
//	
}
